package vue;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JComponent;
import javax.swing.JFrame;


public class Fenetre {
	
	private static JFrame frame;
	
	public Fenetre(String nomFenetre){
		frame = new JFrame(nomFenetre);
		
		WindowAdapter wa = new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}
		};
		frame.addWindowListener(wa);
	}

	public static void add(JComponent component){
		frame.getContentPane().add(component);
		frame.pack();
		frame.setVisible(true);
	}
	
	public static void rafraichir(){
		frame.repaint();
	}
	

}
